import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:industry_net/base/common/colors_util.dart';
import 'package:industry_net/base/common/size_fit.dart';
import 'package:industry_net/base/common/text_util.dart';

class SearchCell extends StatelessWidget {
  const SearchCell({Key? key, required this.index}) : super(key: key);
  final int index;
  Color getIdenColor() {
    switch (index) {
      case 0:
        return const Color(0xffd53814);
      case 1:
        return const Color(0xffeb7c2b);
      case 2:
        return const Color(0xffeba52b);
      default:
        return ColorsUtil.white;
    }
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 44.w,
      margin: EdgeInsets.symmetric(horizontal: gap12),
      padding: EdgeInsets.symmetric(horizontal: gap12),
      color: ColorsUtil.white,
      child: Row(
        children: [
          Container(
            width: 17.w,
            height: 17.w,
            alignment: Alignment.center,
            decoration: BoxDecoration(
              color: getIdenColor(),
              borderRadius: BorderRadius.circular(2.w),
            ),
            child: Text(
              '${index + 1}',
              style: pfMediumStyle(
                  color: index < 3 ? ColorsUtil.white : ColorsUtil.placeholder,
                  fontSize: 13.w),
            ),
          ),
          SizedBox(
            width: gap10,
          ),
          Expanded(
              child: Text(
            '1号梨园',
            style: pfMediumStyle(color: ColorsUtil.title, fontSize: font14),
          )),
          Text(
            '2,153',
            style:
                pfMediumStyle(color: ColorsUtil.placeholder, fontSize: font12),
          )
        ],
      ),
    );
  }
}
